//
//  SPMyInformationViewController.m
//  Sport
//
//  Created by Cass on 2017/12/2.
//  Copyright © 2017年 Cass. All rights reserved.
//

#import "SPMyInformationViewController.h"
#import "SPEditViewController.h"
#import "SPInfoCell.h"
@interface SPMyInformationViewController ()<UITableViewDataSource,UITableViewDelegate>
@property (weak, nonatomic) IBOutlet UIView *backgroundView;
@property (weak, nonatomic) IBOutlet UIImageView *iconView;
@property (weak, nonatomic) IBOutlet UITableView *tableView;


@end

@implementation SPMyInformationViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    self.navigationItem.rightBarButtonItem = [UIBarButtonItem itemWithImage:nil selectedImage:nil title:@"编辑" target:self action:@selector(editClick:)];
}

- (void)editClick:(UIBarButtonItem *)item{
    SPEditViewController *editVC = [[UIStoryboard storyboardWithName:@"Mine" bundle:[NSBundle mainBundle]] instantiateViewControllerWithIdentifier:NSStringFromClass([SPEditViewController class])];
    editVC.title = @"编辑资料";
    [self.navigationController pushViewController:editVC animated:YES];
}

- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView{
    return 1;
}
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section{
    return 7;
}
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath{
    SPInfoCell *cell = [SPInfoCell cellWithTableView:tableView];
    cell.selectionStyle = UITableViewCellSelectionStyleNone;
    if (indexPath.row == 0) {
        cell.type.text = @"昵称";
    }else if (indexPath.row == 1){
        cell.type.text = @"个性签名";
    }else if (indexPath.row == 2){
        cell.type.text = @"性别";
    }else if (indexPath.row == 3){
        cell.type.text = @"年龄";
    }else if (indexPath.row == 4){
        cell.type.text = @"爱好";
    }else if (indexPath.row == 5){
        cell.type.text = @"所在地";
    }else if (indexPath.row == 6){
        cell.type.text = @"职业";
    }
    return cell;
}

- (CGFloat)tableView:(UITableView *)tableView heightForFooterInSection:(NSInteger)section{
    return 3.0f;
}

- (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath{
    return 44.0f;
}
- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    
}



@end
